{{define "cms/index.html"}}
{{ template "header" . }}
<script>
    function logout() {
        $.get("/logout", function(res) {
            var json = $.parseJSON(res);
            if (json.status === 200) {
                window.location.href = "/login";
            }
        })
    }
</script>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li class="nav-header">
                    <span class="clear" style="text-align: center;margin-bottom: 10px">
                    <img src="{{ .pic }}" class="img-circle" width="80px" height="80px" style="padding: 4px;line-height: 1.6;background-color: #f5f8fa;border: 1px solid #ddd;transition: all 0.2s ease-in-out;" alt="">
                    </span>
                    <div class="dropdown profile-element">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                           <span class="clear">
                               <span class="text-muted block m-t-xs" style="text-align: center">
                                   <strong class="font-bold">{{ .name }}</strong>
                                   <span class="caret"></span>
                               </span>
                            </span>
                        </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li>
                                <a class="J_menuItem" href="/changpic">修改头像</a>
                             </li>
                            <li class="divider"></li>
                            <li><a class="J_menuItem" href="/changpwd">密码修改</a>
                            </li>
                            <li class="divider"></li>
                            <li><a onclick="logout()">安全退出</a>
                            </li>
                        </ul>
                    </div>
                    <div class="logo-element">H+
                    </div>
                </li>
                {{ range $i, $v := .lists}}
                <li>
                    <a href="#">
                        <span class="nav-label">{{ $v.Name}}</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="nav nav-second-level">
                        {{range $i2, $v2 := $v.Child}}
                        <li>
                            <a class="J_menuItem" href="{{$v2.Path}}" data-index="0">{{$v2.Name}}</a>
                        </li>
                        {{end}}
                    </ul>

                </li>
                {{end}}
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                </div>
            </nav>
        </div>
        <div class="row content-tabs">
            <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs J_menuTabs">
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active J_menuTab" data-id="index.html">首页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight">
                <i class="fa fa-forward"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">
                    关闭操作<span class="caret"></span>
                </button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right">
                    <li class="J_tabShowActive"><a>定位当前选项卡</a>
                    </li>
                    <li class="divider"></li>
                    <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div>
            <a onclick="logout()" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/home" frameborder="0" data-id="index.html" seamless></iframe>
        </div>
        <div class="footer">
            <div class="pull-right">&copy; 2020
            </div>
        </div>
    </div>
    <!--右侧部分结束-->
</div>

</body>

{{ template "footer" . }}

{{ end }}